<template>
  <div v-if="model&&model.modelKey=='chengjiao'" :key="model.modelKey" class="model_box chengjiao_box">
    <div class="chengjiao_box_inner" :style="`backgroundColor:${model.bgColor||''};`">

      <div class="imgbtn-cont" :style="`${model.bgImage?('backgroundImage:url('+model.bgImage+');'):''}color:${model.txtColor||''}`">
        <div class="sign">昨日商品成交</div>
        <div class="zuori" >
          <span :style="`color:${model.numColor}`">{{model.zuori||88}}</span>
          笔
        </div>
        <div class="zongji">
          总计已安全完成
          <span :style="`color:${model.numColor}`">{{model.zongji||'1000+'}}</span>
          笔交易
        </div>
      </div>
    </div>
    <zhezhao @clickSet="clickItem('set')"></zhezhao>
  </div>
</template>

<script>
import zhezhao from "../zhezhao.vue";
export default {
  components: { zhezhao },
  props: {
    model: {
      type: Object,
      default: () => ({}),
    }
  },
  methods: {
    clickItem(type) {
      this.$emit("clickItem", { type: type, modelKey: this.model.modelKey });
    },
  },
};
</script>
<style lang="scss" scoped>
.chengjiao_box {
  // padding: 0 !important;
  .chengjiao_box_inner {
    padding: 10px;
    padding-bottom: 5px;
    background-color: transparent;
    border-radius: 8px;
  }
  .imgbtn-cont {
    height: 106px;
    background-size: 100% 100%;
    position: relative;
    >div{
      position: absolute;
    }

    .sign{
      font-size: 8px;
      top: 37px;
      left: 40px;
      padding: 2px 12px;
      background-color: #ffba78;
      border-radius: 10px;
      color: #fff;
    }
    .zuori{
      top: 56px;
      left: 45px;
      span{
        font-size: 32px;
        color: #FF5C02;
        font-weight: bold;
      }
    }
    .zongji{
      top: 54px;
      left: 123px;
      font-size: 14px;
      span{
        color: #FF5C02;
        font-weight: bold;
        font-size: 15px;
      }
    }
  }
}
</style>